
import { ref,watch } from 'vue'
export default function (key, value) {
  const storeRage = ref(value)
  if (value) {
    localStorage.setItem(key, JSON.stringify(value))
  } else {
    localStorage.getItem(key)
  }
  watch(storeRage, (newVal) => {
    localStorage.setItem(key, JSON.stringify(newVal))
  })
  return storeRage
}